import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { CommentPageResult, CommentQuery } from "./type";

/**
 * 获取评论分页数据
 *
 * @param queryParams
 */
export function getCommentPage(
  queryParams?: CommentQuery
): AxiosPromise<CommentPageResult> {
  return request({
    url: "/api/comments/page",
    method: "get",
    params: queryParams,
  });
}

/**
 * 批量删除评论
 *
 * @param ids
 */
export function deleteComment(ids: string) {
  return request({
    url: "/api/comments/" + ids,
    method: "delete",
  });
}
